package com.gexiao.context.annotation;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 可选择性的Import组件注册
 * {@link org.springframework.context.annotation.ImportSelector}
 */
public class MyImportSelector implements ImportSelector {
    /**
     *
     * @param importingClassMetadata @import注解的元信息
     * @return 一个或多个类的全限名
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {

        return new String[]{"com.gexiao.bean.Blue","com.gexiao.bean.Yellow"};
    }
}
